#include "d_Light.h"

void d_Light::setPosition(double x, double y, double z, double a)
{
	pos[0]=x;
	pos[1]=y;
	pos[2]=z;
	pos[3]=a;
}

void d_Light::setAmbient(double r, double g, double b, double a)
{
	ambient[0]=r;
	ambient[1]=g;
	ambient[2]=b;
	ambient[3]=a;
}

void d_Light::setDiffuse(double r, double g, double b, double a)
{
	diffuse[0]=r;
	diffuse[1]=g;
	diffuse[2]=b;
	diffuse[3]=a;
}

void d_Light::setSpecular(double r, double g, double b, double a)
{
	specular[0]=r;
	specular[1]=g;
	specular[2]=b;
	specular[3]=a;
}

void d_Light::applyProperties()
{
	glDisable(light_gl);
	glLightfv(light_gl, GL_AMBIENT, ambient);
	glLightfv(light_gl, GL_DIFFUSE, diffuse);
	glLightfv(light_gl, GL_SPECULAR, specular);
	glLightfv(light_gl, GL_POSITION, pos);
	glEnable(light_gl);
}

